package com.alit.face.koala.controller.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;

@RestController
@RequestMapping("spring")
public class SpringController {

  @Autowired
  private ApplicationContext applicationContext;

  @RequestMapping("bean")
  public String bean() {
    String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
    return JSON.toJSONString(beanDefinitionNames);
  }
}
